<?php



require_once "Common/database.php";
require_once "Common/values.php";

   $result = mysql_query("SELECT * FROM tblUsers WHERE Name='$user'");
   $row = mysql_fetch_array($result);
   $system=$row[s];
if($row[s]>0)
{
$result=mysql_query("SELECT * FROM tblsettings");
$row = mysql_fetch_array($result);
echo '<p><h3>System Setting</h3>';
echo '<center><table><form name="settings" action="system/updatesettings.php" method="POST"><tr><td>Property</td><td>Value</td></tr>';

echo '<tr><td>Web Path</td><td><input type="text" name="ip" value="'.$row[ip].'"></td></tr>';
echo '<tr><td>Lansweeper path</td><td><input type="text" name="lansweeper" value="'.$row[lansweeper].'"></td></tr>';
echo '<tr><td>Status page</td><td><input type="text" name="status" value="'.$row[status].'"></td></tr>';
echo '<tr><td>Title</td><td><input type="text" name="title" value="'.$row[title].'"></td></tr>';
echo '<tr><td>Company name</td><td><input type="text" name="company" value="'.$row[company].'"></td></tr>';
echo '<tr><td>System lock</td><td><select name="lock"><option>'.$row[lock].'</option><option>true</option><option>false</option></td></tr>';
echo '<tr><td>Public lock</td><td><select name="plock"><option>'.$row[publiclock].'</option><option>true</option><option>false</option></td></tr>';
echo '<tr><td>Lock reason</td><td><textarea name="lockreason">'.$row[lockreason].'</textarea></td></tr>';
echo '<tr><td>LDAP enable</td><td><select name="ldap"><option>'.$row[ldap].'</option><option>true</option><option>false</option></td></tr>';
echo '<tr><td>LDAP address</td><td><input type="text" name="ldapaddress" value="'.$row[ldapaddress].'"></td></tr>';
echo '<tr><td>LDAP domain</td><td><input type="text" name="domain" value="'.$row[domain].'"></td></tr>';
$result=mysql_query("SELECT * FROM tblldap");
while($row1 = mysql_fetch_array($result))
  {
echo '<tr><td>LDAP dn</td><td><input type="text" size="40" name="dn" value="'.$row1[dn].'"></td></tr>';
  }
echo '<tr><td><a href="index.php?p=shadd&f2=ldap">Add</a></td></tr>';
echo '<tr><td>LDAP username</td><td><input type="text" name="ldapusername" value="'.$row[ldapusername].'"></td></tr>';
echo '<tr><td>LDAP password</td><td><input type="text" name="ldappassword" value="'.$row[ldappassword].'"></td></tr>';
echo '<tr><td>IT group emails enable</td><td><select name="itemails"><option>'.$row[itemails].'</option><option>true</option><option>false</option></td></tr>';
echo '<tr><td>Public emails enable</td><td><select name="publicemails"><option>'.$row[publicemails].'</option><option>true</option><option>false</option></td></tr>';
echo '<tr><td>SMTP server</td><td><input type="text" name="smtp" value="'.$row[smtp].'"></td></tr>';
echo '<tr><td>IT Group email address</td><td><input type="text" name="emailgroup" value="'.$row[emailgroup].'"></td></tr>';
echo '<tr><td>Default proirty</td><td><input type="text" name="defaultpro" value="'.$row[defaultpro].'"></td></tr>';
echo '<tr><td></td><td><input type="submit" value="Update"></td></tr>';
if($system>2)
    {
echo '<tr><td><a href="system/eod.php">Run EOD</td></tr>';
    }
echo '</table></form>';
}
else
{
    echo '<h3>Access Denided</h3>';
}


?>